﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using EZCRS.HCMS.Bll;
using EZCRS.HCMS.Bll.baseinfo;
using EZCRS.HCMS.Web;

namespace EZCRS.HCMS.Web.manage.hotel
{
    public partial class additionalInfo : ManageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckModule(57);
            if (base.BasHotelId == 0)
                Response.Write(CFun.AlertMeg(Resources.Site.MustHotel, "back", ""));

            if (!Page.IsPostBack)
            {
                ArrayList _list = new BllFacility().getaddition(base.BasPropertyId);
                if (_list != null)
                {
                    txtteam.Text = _list[0].ToString();
                    txtmarket.Text = _list[1].ToString();
                }
            }
        }

        protected void btnsave_Click(object sender, EventArgs e)
        {
            if(new BllFacility().saveaddition(base.BasPropertyId,txtteam.Text,txtmarket.Text))
                Page.ClientScript.RegisterClientScriptBlock(typeof(String), "scuress", CFun.AlertMeg(Resources.Site.SystemModifySuccess, "", "additionalinfo.aspx"));
            else
                Response.Write(CFun.AlertMeg(Resources.Site.SystemError, "back", ""));
        }
    }
}
